package com.citcc.business.bean;

import com.citcc.common.annotation.Excel;
import com.citcc.common.utils.StringUtils;

import java.math.BigDecimal;
import java.net.URLDecoder;
import java.util.Date;

public class CdzAppUser {

    /**
     * 主键ID
     */
    private String id;

    /**
     * 手机号即账号
     */
    @Excel(name = "手机号")
    private String phone;

    /**
     * 密码
     */
    private String password;

    /**
     * 更新时间
     */
    private Date updateTime;

    /**
     * 0:正常 1:删除
     */
    private String delFlag;

    /**
     * 备注
     */
    private String remark;

    /**
     * 设备ID
     */
    private String deviceId;

    /**
     * 机构ID
     */
    private String orgId;

    /**
     * 手机验证码
     */
    private String code;

    /**
     * 昵称
     */
    @Excel(name = "昵称")
    private String nickName;

    /**
     * 头像
     */
    @Excel(name = "头像")
    private String headImg;

    /**
     * 登录时间
     */
    @Excel(name = "登录时间", width = 20, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date loginTime;

    /**
     * 创建时间
     */
    @Excel(name = "注册时间", width = 20, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
     * 支付宝账号
     */
    @Excel(name = "支付宝账号")
    private String alipayAccount;

    /**
     * 支付宝绑定状态 0-已绑定 1-未绑定
     */
    @Excel(name = "支付宝绑定状态", readConverterExp = "0=已绑定,1=未绑定,null=")
    private String alipayState;

    /**
     * 支付宝绑定时间
     */
    @Excel(name = "支付宝绑定时间", width = 20, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date alipayTime;

    /**
     * 支付宝openId
     */
    private String alipayOpenid;

    /**
     * 支付宝昵称
     */
    private String alipayName;

    /**
     * 支付宝头像
     */
    private String alipayHead;

    /**
     * 微信账号
     */
    @Excel(name = "微信账号")
    private String wechatAccount;

    /**
     * 微信绑定状态 0-已绑定 1-未绑定
     */
    @Excel(name = "微信绑定状态", readConverterExp = "0=已绑定,1=未绑定,null=")
    private String wechatState;

    /**
     * 微信绑定时间
     */
    @Excel(name = "微信绑定时间", width = 20, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date wechatTime;

    /**
     * 微信openId
     */
    private String wechatOpenid;

    /**
     * 微信昵称
     */
    private String wechatName;

    /**
     * 微信头像
     */
    private String wechatHead;

    /**
     * 账户余额
     */
    @Excel(name = "账户余额")
    private BigDecimal accountMoney;

    /**
     * 可用余额
     */
    @Excel(name = "可用余额")
    private BigDecimal availableMoney;

    /**
     * 冻结金额
     */
    @Excel(name = "冻结金额")
    private BigDecimal freezeMoney;

    /**
     * 客户类型
     *
     * @return
     */
    @Excel(name = "客户类型", readConverterExp = "0=普通用户,1=内部用户,null=")
    private String userType;

    /**
     * 设备类型 0Android 1ios
     */
    private String type;

    /**
     * 编码后的昵称
     *
     * @return
     */
    private String nickNameEncode;

    private String dateTime;

    public String getDateTime() {
        return dateTime;
    }

    public void setDateTime(String dateTime) {
        this.dateTime = dateTime;
    }

    public String getNickNameEncode() {
        return nickNameEncode;
    }

    public String getNickNameEncodeValue() {
        if (StringUtils.isNotBlank(nickNameEncode)) {
            try {
                return URLDecoder.decode(nickNameEncode, "UTF-8");
            } catch (Exception e) {
            }
        }
        return nickNameEncode;
    }

    public void setNickNameEncode(String nickNameEncode) {
        this.nickNameEncode = nickNameEncode;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getUserType() {
        return userType;
    }

    public void setUserType(String userType) {
        this.userType = userType;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getHeadImg() {
        return headImg;
    }

    public void setHeadImg(String headImg) {
        this.headImg = headImg;
    }

    public Date getLoginTime() {
        return loginTime;
    }

    public void setLoginTime(Date loginTime) {
        this.loginTime = loginTime;
    }

    public String getAlipayAccount() {
        return alipayAccount;
    }

    public void setAlipayAccount(String alipayAccount) {
        this.alipayAccount = alipayAccount;
    }

    public String getAlipayState() {
        return alipayState;
    }

    public void setAlipayState(String alipayState) {
        this.alipayState = alipayState;
    }

    public Date getAlipayTime() {
        return alipayTime;
    }

    public void setAlipayTime(Date alipayTime) {
        this.alipayTime = alipayTime;
    }

    public String getWechatAccount() {
        return wechatAccount;
    }

    public void setWechatAccount(String wechatAccount) {
        this.wechatAccount = wechatAccount;
    }

    public String getWechatState() {
        return wechatState;
    }

    public void setWechatState(String wechatState) {
        this.wechatState = wechatState;
    }

    public Date getWechatTime() {
        return wechatTime;
    }

    public void setWechatTime(Date wechatTime) {
        this.wechatTime = wechatTime;
    }

    public BigDecimal getAccountMoney() {
        if (accountMoney != null) {
            return accountMoney.setScale(2, BigDecimal.ROUND_HALF_UP);
        } else {
            return accountMoney;
        }
    }

    public void setAccountMoney(BigDecimal accountMoney) {
        this.accountMoney = accountMoney;
    }

    public BigDecimal getAvailableMoney() {
        if (availableMoney != null) {
            return availableMoney.setScale(2, BigDecimal.ROUND_HALF_UP);
        } else {
            return availableMoney;
        }

    }

    public void setAvailableMoney(BigDecimal availableMoney) {
        this.availableMoney = availableMoney;
    }

    public BigDecimal getFreezeMoney() {
        if (freezeMoney != null) {
            return freezeMoney.setScale(2, BigDecimal.ROUND_HALF_UP);
        } else {
            return freezeMoney;
        }
    }

    public void setFreezeMoney(BigDecimal freezeMoney) {
        this.freezeMoney = freezeMoney;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public String getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(String delFlag) {
        this.delFlag = delFlag;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getDeviceId() {
        return deviceId;
    }

    public void setDeviceId(String deviceId) {
        this.deviceId = deviceId;
    }

    public String getOrgId() {
        return orgId;
    }

    public void setOrgId(String orgId) {
        this.orgId = orgId;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getAlipayOpenid() {
        return alipayOpenid;
    }

    public void setAlipayOpenid(String alipayOpenid) {
        this.alipayOpenid = alipayOpenid;
    }

    public String getAlipayName() {
        return alipayName;
    }

    public void setAlipayName(String alipayName) {
        this.alipayName = alipayName;
    }

    public String getAlipayHead() {
        return alipayHead;
    }

    public void setAlipayHead(String alipayHead) {
        this.alipayHead = alipayHead;
    }

    public String getWechatOpenid() {
        return wechatOpenid;
    }

    public void setWechatOpenid(String wechatOpenid) {
        this.wechatOpenid = wechatOpenid;
    }

    public String getWechatName() {
        return wechatName;
    }

    public void setWechatName(String wechatName) {
        this.wechatName = wechatName;
    }

    public String getWechatHead() {
        return wechatHead;
    }

    public void setWechatHead(String wechatHead) {
        this.wechatHead = wechatHead;
    }
}